{% extends '/odc/dashboard.html' %}
{% block operation %}

<script type="text/javascript">
    $(document).ready(function () {
    $(".Preview").hide()
$(".Edit_dao").hide()
$(".ricercaBox").hide()
        $('#tableContainer').jtable({
            title: 'Tabella Ruoli',
            messages: window.italianMessages,
            defaultDateFormat:"dd-mm-yy",
            paging: true,
            pageSize: 20,
            sorting: true,
            defaultSorting: 'name ASC',

            actions: {
                listAction: '/odc/as_Ruolo/List',
                createAction: '/odc/as_Ruolo/Create',
                updateAction: '/odc/as_Ruolo/Update',
                deleteAction: '/odc/as_Ruolo/Delete'
            },
            fields: {
                id: {
                    key: true,
                    create: false,
                    edit: false,
                    list: false
                },

                name: {
                    title: 'Nome',
                    width: '8%',
                    inputClass: 'validate[required]'
                },
                descrizione: {
                    title: 'Descrizione',
                    width: '9%',
                    inputClass: 'validate[required]'
                },
            },
            //Initialize validation logic when a form is created
            formCreated: function (event, data) {
                data.form.validationEngine();
            },
            //Validate form when it is being submitted
            formSubmitting: function (event, data) {
                return data.form.validationEngine('validate');
            },
            //Dispose validation logic when form is closed
            formClosed: function (event, data) {
                data.form.validationEngine('hide');
                data.form.validationEngine('detach');
            }
        });
        //Re-load records when user click 'load records' button.
        $('#LoadRecordsButton').click(function (e) {
            e.preventDefault();
            $('#tableContainer').jtable('load', {
                fk_name: $('#name').val(),
            });
        });
        $('#LoadRecordsButton2').click(function (e) {
            $('#tableContainer').jtable('load', {
            });
        });


        $('#tableContainer').jtable('load');

});
</script>
<div id="box">
    <h2><a href="/pg/parametri">PARAMETRI:</a> Anagrafica Ruoli <a id="iconaricerca" href="#"><img  src="/tpl/img/icona-lente48.png" /></a></h2>
<br><br>

    <div class="ricercaBox">
    <form>

<fieldset>
<div class="entry">Nome:<input type="text" name="name"  id="name" size="20" /></div>         <br>


<p><input type="submit"  id="LoadRecordsButton" value="Search"/>&nbsp;<input id="LoadRecordsButton2" onclick="clear_form_elements(this.form)" type="reset" value="Pulisci" />
 </p>
        </fieldset>
        </form>
</div>

<div id="tableContainer"></div>
        </div>

{%endblock%}
